package acm.pta9;

import java.util.Scanner;

public class 一亿代码 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n = Integer.parseInt(sc.nextLine());
        while (n-- > 0) {
            String str = sc.nextLine();
            System.out.println(str);
            str=trim(str);
            str=lower(str);
            str=replaceCan(str);
            str=replaceYou(str);
            str=str.replaceAll("\\?","!");
            str=str.replaceAll("A","I can");
            str=str.replaceAll("B","I could");
            str=str.replaceAll("C","you");
            System.out.println("AI: "+str);
        }
    }
    public static String lower(String str) {
        StringBuilder sb=new StringBuilder(str);
        for (int i = 0; i < str.length(); i++) {
            if (str.charAt(i) >= 'A' && str.charAt(i) <= 'Z'&& str.charAt(i) != 'I'){
                sb.setCharAt(i, (char) (str.charAt(i) + 32));
            }
        }
        return sb.toString();
    }
    public static String trim(String str){
        str=str.trim();
        str=str.replaceAll(" +(?=[^a-zA-Z1-9])","");
        str = str.replaceAll(" +", " ");
        return str;
    }
    public static String replaceCan(String str){
        str=str.replaceAll("\\bcan you\\b","Hello");    //I can
        str=str.replaceAll("\\bcould you\\b","B");  //I could
        return str;
    }
    public static String replaceYou(String str){
        str=str.replaceAll("\\b(I|me)\\b", "C");    //you
        return str;
    }
}
